package com.situ.day3;

import static org.junit.Assume.assumeFalse;

import org.junit.Test;

public class ForTest {

	public static void main(String[] args) {
		//1~100的和
		int sum = 0;
		for (int i = 1; i <= 100; i++) {
			sum = sum + i;
		}
		System.out.println("sum=" + sum);
	}

	//1~100以内7的倍数的个数
	@Test
	public void TimesOfSeven() {
		int count = 0;
		for (int i = 1; i <= 100; i++) {
			if (i % 7 == 0) {
				System.out.print(i + " ");
				count++;
			}
		}
		System.out.println();
		System.out.println("The amount of seven:" + count);
	}

	//九九乘法表
	@Test
	public void MulTabl() {
		for (int i = 1; i < 10; i++) {
			for (int j = 1; j <= i; j++) {
				System.out.print(j + "*" + i + "=" + j * i + "\t");
			}
			System.out.println();
		}
	}
	
	@Test
	public void Triangle() {
		for (int i = 1; i <=5; i++) {
			for (int j = 1; j <= i; j++) {
				System.out.print("*");
			}
			System.out.println();
		}
	}
}
